Scripts: Updates to scripts using sof-testbench4 simulation#10545
Scripts: Updates to scripts using sof-testbench4 simulation#10545lgirdwood merged 6 commits intothesofproject:mainfrom
Conversation
This change adds option --mem_model to xt-run command. It should give better realistic MCPS and cycles numbers for processing with the more accurate memory model. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
There was a problem hiding this comment.
Pull request overview
Updates sof-testbench4-related configuration and scripts to use a new DRC default preset and to expand profiling/testing coverage for additional components.
Changes:
- Add a new DRC preset selector (
default_speaker_mic) for bench capture/playback control configs and set it as the default in bench target CMake parameters. - Extend sof-testbench helper/build scripts with separate output-rate option handling and updated xt-run invocation flags.
- Expand profiling and host test coverage to include additional components/modules.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/topology/topology2/include/bench/drc_controls_playback.conf | Adds a new DRC preset key for playback that maps to a speaker-oriented DRC config. |
| tools/topology/topology2/include/bench/drc_controls_capture.conf | Adds a new DRC preset key for capture that maps to a DMIC-oriented DRC config. |
| tools/topology/topology2/development/tplg-targets-bench.cmake | Switches bench default DRC params to the new default_speaker_mic selector. |
| scripts/sof-testbench-helper.sh | Adds -R handling and updates xt-run calls to include --mem_model. |
| scripts/sof-testbench-build-profile.sh | Splits module profiling lists and adds an extra profiling loop at 44.1k. |
| scripts/host-testbench.sh | Adds host testbench coverage for additional components. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| } | ||
|
|
||
| MODULES_S32="asrc dcblock drc drc_multiband eqfir eqiir gain src tdfb" | ||
| MODULES_S32_44K_48K="asrc src" |
There was a problem hiding this comment.
The variable name MODULES_S32_44K_48K implies these modules should be profiled at both 44.1k and 48k, but the loop only runs at 44100. Either rename the variable to match the implemented behavior (e.g., MODULES_S32_44K) or add a second run at 48000 to align with the name.
| for mod in $MODULES_S32_44K_48K | ||
| do | ||
| echo "Profiling $mod ..." | ||
| $HELPER -r 44100 -x -m "$mod" \ | ||
| -p "$PDIR/profile-$PLATFORM-$mod.txt" > "$PDIR/log-$PLATFORM-$mod.txt" | ||
| done |
There was a problem hiding this comment.
The variable name MODULES_S32_44K_48K implies these modules should be profiled at both 44.1k and 48k, but the loop only runs at 44100. Either rename the variable to match the implemented behavior (e.g., MODULES_S32_44K) or add a second run at 48000 to align with the name.
There was a problem hiding this comment.
The input is 44.1 kHz and output is 48 kHz, so the test really runs at both rates.
There was a problem hiding this comment.
good idea to add 44100 testing! We should maybe add such a test to PR CI too?..
There was a problem hiding this comment.
It would be quite simple with a scripts/hosts-testbench.sh change.
| VALGRIND= | ||
|
|
||
| while getopts "b:c:hi:km:n:o:p:r:t:vx" opt; do | ||
| while getopts "b:c:hi:km:n:o:p:r:R:t:vx" opt; do |
There was a problem hiding this comment.
A new -R option is introduced for output rate. Make sure the script’s help/usage text documents -R (and clarifies the distinction between -r input rate and -R output rate), otherwise users will not discover the new option from -h.
| r) | ||
| RATE_IN=${OPTARG} | ||
| ;; | ||
| R) | ||
| RATE_OUT=${OPTARG} | ||
| ;; |
There was a problem hiding this comment.
A new -R option is introduced for output rate. Make sure the script’s help/usage text documents -R (and clarifies the distinction between -r input rate and -R output rate), otherwise users will not discover the new option from -h.
| "$XTENSA_PATH"/xt-run --mem_model --profile="$PROFILEOUT" "$XTB4" $OPTS 2> "$TRACEFILE" | ||
| "$XTENSA_PATH"/xt-gprof "$XTB4" "$PROFILEOUT" > "$PROFILETXT" | ||
| else | ||
| "$XTENSA_PATH"/xt-run "$XTB4" $OPTS 2> "$TRACEFILE" | ||
| "$XTENSA_PATH"/xt-run --mem_model "$XTB4" $OPTS 2> "$TRACEFILE" |
There was a problem hiding this comment.
--mem_model is now always passed to xt-run. If this script is expected to work across multiple Xtensa toolchain versions/environments, consider making this flag configurable (env var or script option) or add a small compatibility fallback when xt-run doesn’t recognize --mem_model (e.g., retry without the flag).
There was a problem hiding this comment.
I'm not aware of a toolchain version without support for --mem_model.
This change does input rate changing with -r and to change both input and output rate, need to specify both -r and -R. With this change it's easy to test e.g. performance of 44100 to 48000 SRC with "-r 44100". Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The SRC perf numbers are unrealistic low when tested with 48 kHz input. This change adds a test list for components with 44.1 kHz input and 48 kHz output. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch adds dolby-dax (mock), level_multiplier, micsel, sound_dose, stft_process and template_comp into profiled list. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch changes the blobs in playback and capture DRC test topologies to speaker and microphone defaults. It improves test coverage of DRC since the previously used "enabled" blob does very little processing for the audio signal. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch adds Dolby DAX (stub version), level_multiplier, micsel, sound_dose to scripts/host-testbench.sh. Running this quick test for sane output and memory violations with Valgrind helps to avoid regressions in the modules. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
36c1019 to
09315da
Compare
No description provided.